package jobs;

import java.util.List;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import com.aton.job.BaseJob;

import models.WdTask;
import play.jobs.Every;

/**
 * 
 * 微代任务自动处理程序<br />
 * 
 *
 * 
 * @author zhiyuan
 * @version v1.0
 * @since 2017年3月31日 上午7:21:59
 */
@Every("1min")
public class WdTaskProcessJob extends BaseJob {
	public static final Logger log = LoggerFactory.getLogger(WdTaskProcessJob.class);

	@Override
	public void doJob() throws Exception {

		//处理分享任务过期
		List<WdTask> list = WdTask.listOverdueTask();
		for(WdTask task : list){
			task.processOverdue();
		}

		List<WdTask> finishedTaskList  = WdTask.listFinishedTask();
		for(WdTask task : finishedTaskList){
			task.finishTask();
		}

		super.doJob();
	}

	
	
}
